# -*- makefile -*-

LIBUTL/     :=$(realpath $/../../libutil/)/
MTDIR/      :=${LIBUTL/}mt19937ar/

$/.C_EXES     := $/mt19937ar-test
$/.C_SRCS     := $/mt19937ar.c $/test.c
$/.C_LIBS     := $/libmt19937ar.a

$/.CLEAN      := $/*.o $/test.c $/diffs
$/.REAL-CLEAN := $/*.o $/test.c $/diffs $/mt19937ar-test

$/libmt19937ar.a: $/mt19937ar.o $/test.o

$/mt19937ar-test: $/mt19937ar.o $/mt19937ar-test.o

$/test.c: $/mt19937ar-test
	${MTDIR/}mt19937ar-test | diff - ${MTDIR/}mt19937ar.out > ${MTDIR/}diffs 2>&1
	if test -s ${MTDIR/}diffs ; then echo 'MT19937: TEST FAILED'; else echo 'MT19937: Test Passed'; fi
	touch ${MTDIR/}test.c
	${MTDIR/}mt19937ar-test | diff - ${MTDIR/}mt19937ar.out

#$(eval $/%.d $/%.o:  CFLAGS+= -I..)
